﻿@{
    string type = ViewData["type"] as string;
    string formatString;
    string startStatement;
    string endStatement;
    if (type == "Day")
    {
        formatString = TBConfig.Instance().DayDateTimeFormat;
        startStatement = "开始日期";
        endStatement = "结束日期";
    }
    else
    {
        if (type == "Hour")
        {
            formatString = TBConfig.Instance().HourDateTimeFormat;
        }
        else
        {
            formatString = TBConfig.Instance().MinuteDateTimeFormat;
        }
        startStatement = "开始时间";
        endStatement = "结束时间";
    }
}
<div class="contrl">
    <label>@startStatement：</label>
    <input type="text" class="input time-input" name="startTime" id="startTime" onclick="WdatePicker({ dateFmt:'@formatString', el:'startTime', maxDate:'#F{$dp.$D(\'endTime\')}', isShowClear:false, readOnly:true})" value="@Convert.ToDateTime(ViewData["startTime"]).ToString(formatString)">
</div>
<div class="contrl">
    <label>@endStatement：</label>
    <input type="text" class="input time-input" name="endTime" id="endTime" onclick="WdatePicker({ dateFmt:'@formatString', el:'endTime', minDate:'#F{$dp.$D(\'startTime\')}', isShowClear:false, readOnly:true})" value="@Convert.ToDateTime(ViewData["endTime"]).ToString(formatString)">
</div>